

export default {
    // state 形参 =>  通过state获取state对象中的数据 
    // getters 形参 =>  通过getters获取getters对象中的数据   (可以复用计算属性)
    doubleA: function (state) {
      return state.a * 2;
    },
    tripleA: function (state) {
      return state.a * 3;
    },
    doubleB: function (state) {
      return state.b * 2;
    },
    tripleB: function (state) {
      return state.b * 3;
    },
    // doubleBoth =  doubleA + doubleB  ( doubleA , doubleB计算属性)
    both: function (state) {
      return state.a + state.b;
    },
    doubleBoth: function (state, getters) {
      // return state.a * 2 + state.b * 2;   // low  => 没有复用doubleA , doubleB
      return getters.doubleA + getters.doubleB;
    }

}